package com.rp.system.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rp.system.dao.SysLogDao;
import com.rp.system.po.SysLog;

@Service
@Transactional
public class SysLogService {

	@Autowired
	private SysLogDao sysLogDao;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	/**
	 * 保存日志
	 * @param sl
	 * @return
	 */
	public String saveSysLog(SysLog sl){
		return (String) sysLogDao.save(sl);
	}
	
	/**
	 * 清空所有日志
	 */
	public void removeAll(){
		jdbcTemplate.execute("DELETE FROM RP_SYSTEM_SYSLOGS");
	}
	
	
	
	
	public SysLogDao getSysLogDao() {
		return sysLogDao;
	}
	
}
